package com.packet.mybatis.mapper;

import com.packet.pojo.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @className:EmployeeMapper
 * @Author:wallet_packet Date:2023-11-11 14:10
 * @Describe:
 */
@Repository
@Mapper
public interface EmployeeMapper {
    //private static Map<Integer , Employee> employees = null;
    ////员工部门
    //@Autowired
    //private DepartmentMapper departmentMapper;



    //增加一个员工
    //private static Integer inintId = 1006;
    //public void save(Employee employee){
    //    if (employee.getId() == null) {
    //        employee.setId(inintId);
    //        inintId++;
    //    }
    //    employee.setDepartment(departmentMapper.getDepartmentById(employee.getDepartment().getId()));
    //    employees.put(employee.getId(),employee);
    //}
    //
    ////查询全部员工
    //public Collection<Employee> getAll() {
    //    return employees.values();
    //}
    //
    ////通过id查员工
    //public Employee getEmployeeById(Integer id){
    //    return employees.get(id);
    //}
    //
    ////删除员工通过id
    //public void delete(Integer id){
    //    employees.remove(id);
    //}


    //增加一个员工

    public void save(Employee employee);

    //查询全部员工
    public List<Employee> getAll();

    //通过id查员工
    public Employee getEmployeeById(Integer id);

    //删除员工通过id
    public void delete(Integer id);

    public void update(Employee employee);
}
